{%extends file="user/page/layout.tpl"%}

{%block name="sub-head-static"%}
    {%require name="user:static/buydemandnewuser/buydemandnewuser.less"%}
    {%require name="user:static/buydemandnewuser/buydemandnewuser.js"%}
    <script>
        P.data('data',{%json_encode($data)%});
    </script>
{%/block%}

{%block name="right-content"%}
<div class="page-buydemandnewuser">

    <div class="block assets-block">
        <div class="title">活期购买</div>
        <div class="left">
            <div class="year-profit">{%($data.compound_year_rate*100)|format_amount%}{%if !$data.additional%}%{%/if%}{%if $data.additional%}<span>+{%($data.additional*100)|format_amount%}%</span>{%/if%}</div>
            <span>今日年化收益率</span>
        </div>

        <div class="right">
            <div>新注册用户独享</div>
            <div style="color:#ffc72d">1000优先购买份额</div>
        </div>

        <div class="clear"></div>
    </div>

    {%if $data.preemption<1000%}
    <div class="block buy-block">
        <div class="line">
            <span class="second-title">新人购买特权：</span>
            <span class="money" style="color:#ffc72d">￥{%1000-$data.preemption|format_amount:0%}</span>
        </div>
        <div class="line">
            <span class="second-title">账户可用余额：</span>
            <span class="money">￥{%$data.amount|format_amount:2%}</span>
            <a href="/user/recharge" class="text-link">充值</a>
        </div>
        {%if $data.coupon.doing.amount != null%}
        <div class="coupon-block">
            <div class="left">
                <span class="use_icon"></span>
            </div>
            <div class="right">
                <div class="line">使用<span class="red">“我的红包”</span></div>
                <div class="line">
                    <input type="checkbox" class="use_coupon" data="{%$data.coupon.doing.amount%}">
                    {%$data.coupon.doing.desc_type%}
                    <span class="red">￥{%$data.coupon.doing.amount%}</span>
                    （有效期：{%$data.coupon.doing.period_validity%}）
                </div>
                <div class="line coupon_info">小提示：无论支付金额多少，此红包仅可使用一次。</div>
            </div>
            <div class="clear"></div>
        </div>
        {%/if%}
        <div class="line">
            <div class="money-input">
                <span>￥</span>
                <input type="text" class="amount" placeholder="请输入购买金额">
            </div>
        </div>
        <div class="buy_confirm">
            <div class="line">
                实际支付金额：<span class="value"></span>
            </div>
            <div class="line">
                <button class="btn btn-large btn-main b
                tn-buy">购买</button>
            </div>
        </div>
    </div>

    <div class="block tip-block">
        <h5>温馨提示：</h5>
        <p>1、新注册用户优先购买特权是指：无论真融宝活期的当前可购份额是否为0，均可不用抢购和等待，直接购买不大于1000的真融宝活期份额。</p>
        <p>2、新注册用户可在此通道多次享受购买特权，直到累计购买份额达到1000。</p>
        <p>3、活期购买成功后，当日即可获得收益，次日显示在我的收益中。</p>
        <p>4、真融宝活期会将您昨日产生的收益转为本金，进行自动复投，实现循环式的增值。</p>
        <p>5、真融宝活期金额可随时赎回到我的帐户。</p>

    </div>
    {%else%}
    <div class="block tip-block" style="background: #fff1a6">
        <h5>您不可以享受该特权，可能原因是：</h5>
        <p>您的1000优先购买份额已经使用完啦。</p>
    </div>
    {%/if%}
</div>
{%/block%}
